#import "OmBaseScrollVC.h"
@interface OmBaseScrollVC ()
@property (nonatomic, strong) UIScrollView *scrollView;
@end
@implementation OmBaseScrollVC
- (void)viewDidLoad {
    [self allocateScrollView];
    [super viewDidLoad];
}
- (void)allocateScrollView {
    self.scrollView = [[UIScrollView alloc] init];
    [self.view addSubview:self.scrollView];
    [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self.view);
    }];
    self.scrollContentView = [[UIView alloc] init];
    [self.scrollView addSubview:self.scrollContentView];
    [self.scrollContentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.scrollView);
    }];
}
- (void)changeScrollMode:(ScrollMode)scrollMode {
    switch (scrollMode) {
        case ScrollModePortrait: {
            [self.scrollContentView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.width.equalTo(self.scrollView);
            }];
        }
            break;
        case ScrollModeLandscape: {
            [self.scrollContentView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.height.equalTo(self.scrollView);
            }];
        }
            break;
    }
}
@end
